<head>
	<script type="text/javascript" charset="utf-8">
	function getPosition() {
		function handlePosition(position) {
			document.getElementById("lat").innerHTML = position.coords.latitude;
			document.getElementById("lon").innerHTML = position.coords.longitude;
		}
		navigator.geolocation.getCurrentPosition(handlePosition)
	}
	</script>
</head>
<body onload='getPosition()'>
	Your latitude: <span id="lat"></span><br/>
	Your longitude: <span id="lon"></span>
</body>

		